// 导出参数
import request from "@/utils/request";

//新建
export function create(data) {
  return request({
    url: '/infra/consult/create',
    method: 'post',
    data: data
  })
}

//分页管理列表数据
export function getPage(params) {
  return request({
    url: '/infra/consult/page',
    method: 'get',
    params: params
  })
}

//直接获取所有管理列表数据--获取所有问答标题
export function getPageAll(data) {
  return request({
    url: '/infra/consult/choose',
    method: 'post',
    data: data
  })
}

//编辑回显
export function getBack(params) {
  return request({
    url: '/infra/consult/get',
    method: 'get',
    params: params
  })
}

// 修改确定
export function update(data) {
  return request({
    url: '/infra/consult/update',
    method: 'put',
    data: data
  })
}

// 发布接口
export function release(data) {
  return request({
    url: '/infra/consult/release',
    method: 'put',
    data: data
  })
}

//删除行
export function getDelete(id){
  return request({
      url:'/infra/consult/delete?id=' + id,
      method:'delete',
  })
}

//批量删除
export function batchDel(params) {
  return request({
      url: '/infra/consult/batchDelete',
      method: 'delete',
      data: params
  })
}

//获取回复
export function robotChat(data) {
  return request({
    url: '/infra/consult-history/robotChat',
    method: 'post',
    data: data
  })
}

//获取历史数据
export function chatHistory(data) {
  return request({
    url: '/infra/consult-history/chatHistory',
    method: 'post',
    data: data
  })
}


//问答分类-----

//创建问答分类
export function createCategory(data) {
  return request({
    url: '/infra/consult-category/create',
    method: 'post',
    data: data
  })
}
//删除问答分类
export function delCategory(id){
  return request({
      url:'/infra/consult-category/delete?id=' + id,
      method:'delete',
  })
}
//获得问答分类-编辑回显
export function getBackCategory(params) {
  return request({
    url: 'infra/consult-category/get',
    method: 'get',
    params: params
  })
}
// 更新问答分类-修改确定
export function updateCategory(data) {
  return request({
    url: '/infra/consult-category/update',
    method: 'put',
    data: data
  })
}

//分类管理列表数据
export function getPageCategory(params) {
  return request({
    url: '/infra/consult-category/page',
    method: 'get',
    params: params
  })
}

//获取左侧表单分类列表
export function getLeftCategory(params) {
  return request({
    url: '/infra/consult-category/list',
    method: 'get',
    params: params
  })
}


